package com.ecnu.web.controller.project;


import com.ecnu.common.core.controller.BaseController;
import com.ecnu.common.core.domain.AjaxResult;
import com.ecnu.common.core.page.PageDomain;
import com.ecnu.common.core.page.TableDataInfo;
import com.ecnu.system.service.IPublicDataApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.Min;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zdn
 * @since 2025-03-25
 */
@Api(tags = "学校创新实践活动接口")
@RestController
@RequestMapping("/public/api")
public class PublicApiController extends BaseController {
    @Autowired
    private IPublicDataApiService publicDataApiService;

    @ApiOperation(value = "获取学校活动信息")
    @GetMapping("/dataList")
    public TableDataInfo getPublicData(@Min(1) @RequestParam(defaultValue = "1") Integer pageNum,
                                    @RequestParam(defaultValue = "10") Integer pageSize) {
        PageDomain domain = new PageDomain();
        domain.setPageNum(pageNum);
        domain.setPageSize(pageSize);
        return publicDataApiService.getPublicData(domain);
    }

}
